import React, { Component } from 'react';
import { Route , Switch ,Redirect} from "react-router-dom"
import connect from './connect';

import Home from './views/Home';
import User from './views/User';
import Cinema from './views/Cinema';
import Detail from './views/detail';
import Login from './views/denlu';
import Like from './views/Like';
import Collect from './views/Collect';

class App extends Component {

  render() {
    return (
      <>
        <Switch>
          <Route path={"/home"} component={Home}/>
          <Route path={"/user/like"} component={Like}/>
          <Route path={"/user/collect"} component={Collect}/>
          <Route path={"/user"} component={User}/>
          <Route path={"/cinema"} component={Cinema}/>
          <Route path={"/detail/:id?"} component={Detail}/>
          <Route path={"/login"} component={Login}/>
          <Route exact path="/" render={() => <Redirect to="/home" />} />
        </Switch>
      </>
    );
  }
}

export default connect(App);
